List view with two or more columns

Hi,

I try to realise a listView with two or more columns. I tried to build something based on the DXL help but it doesn't work. What I want is a listView with columns but I got two listViews with each one column.

Does anybody know how to add a second column?
 

DB komponentenAuswahl = create "Komponenten Auswahl" 
 
void startExport(DB value) { 
         // nothing to do a.t.m.
}
 
string hauptprozesse[] = {
    "Prozess A"
        "Prozess B"
}
 
string teilprozesse[] = {
        "Prozess A"
        "Prozess B"
}
 
// generate listView elements
DBE komponentenCheckbox = listView(komponentenAuswahl,0 , 250, 20, hauptprozesse)
DBE komponentenCheckboxB = listView(komponentenAuswahl,0 , 250, 20, teilprozesse)
 
apply(komponentenAuswahl, "Filtern", startExport)
 
realize komponentenAuswahl 
 
// ad the columns
insertColumn(komponentenCheckbox, 0, "Komponenten", 40, iconNone)
insertColumn(komponentenCheckboxB, 1, "Komponenten 2", 40, iconNone)
 
show komponentenAuswahl

TCDev. - Thu Feb 17 08:09:22 EST 2011

Re: List view with two or more columns
SystemAdmin - Thu Feb 17 08:25:23 EST 2011

Well, you are adding two DBEs so you get two listViews. Add only one and insert the columns to that:
 

DB komponentenAuswahl = create "Komponenten Auswahl" 
 
void startExport(DB value) { 
         // nothing to do a.t.m.
}
 
string hauptprozesse[] = {
    "Prozess A"
        "Prozess B"
}
 
string teilprozesse[] = {
        "Prozess A"
        "Prozess B"
}
 
// generate listView elements
DBE komponentenCheckbox = listView(komponentenAuswahl,0 , 250, 20, hauptprozesse)
 
apply(komponentenAuswahl, "Filtern", startExport)
 
realize komponentenAuswahl 
 
// ad the columns
insertColumn(komponentenCheckbox, 0, "Komponenten", 40, iconNone)
insertColumn(komponentenCheckbox, 1, "Komponenten 2", 40, iconNone)
 
show komponentenAuswahl

Re: List view with two or more columns
TCDev. - Thu Feb 17 09:04:54 EST 2011

SystemAdmin - Thu Feb 17 08:25:23 EST 2011

Well, you are adding two DBEs so you get two listViews. Add only one and insert the columns to that:
 

DB komponentenAuswahl = create "Komponenten Auswahl" 
 
void startExport(DB value) { 
         // nothing to do a.t.m.
}
 
string hauptprozesse[] = {
    "Prozess A"
        "Prozess B"
}
 
string teilprozesse[] = {
        "Prozess A"
        "Prozess B"
}
 
// generate listView elements
DBE komponentenCheckbox = listView(komponentenAuswahl,0 , 250, 20, hauptprozesse)
 
apply(komponentenAuswahl, "Filtern", startExport)
 
realize komponentenAuswahl 
 
// ad the columns
insertColumn(komponentenCheckbox, 0, "Komponenten", 40, iconNone)
insertColumn(komponentenCheckbox, 1, "Komponenten 2", 40, iconNone)
 
show komponentenAuswahl

Hi Pekka_Makinen,

thanks for your very fast reply. The second column is now visible in the listView. But how can I put values into that column?

It shall look like this:

MainProcess | SubProcess
Process A | Sub A
Process A | Sub B
Process B | Sub C
...

Re: List view with two or more columns
SystemAdmin - Thu Feb 17 10:30:20 EST 2011

TCDev. - Thu Feb 17 09:04:54 EST 2011
Hi Pekka_Makinen,

thanks for your very fast reply. The second column is now visible in the listView. But how can I put values into that column?

It shall look like this:

MainProcess | SubProcess
Process A | Sub A
Process A | Sub B
Process B | Sub C
...

Use the "insert" (to insert data into zeroth column) and "set" (to insert data into other columns) functions. These are described in the DXL Help, but note that there are multiple versions of these functions, use the versions for listviews.

Re: List view with two or more columns
TCDev. - Fri Feb 18 07:34:22 EST 2011

Thanks for your help - that worked for me.
 

set(komponentenCheckbox, 1, 1, "Test")